import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

class PicReview extends StatefulWidget {
  final String? url;
  final String? title;
  const PicReview({super.key, this.url,this.title});

  @override
  State<PicReview> createState() => _State();
}

class _State extends State<PicReview> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.white,
        elevation: 0,
        // shadowColor: Colors.transparent,
        surfaceTintColor: Colors.white,
        leading: IconButton(
          icon: const Icon(Icons.arrow_back_ios, color: Colors.black, size: 16),
          onPressed: () {
            // 返回上一页的逻辑
            context.pop();
            // context.push('/WheelPickerExample');
          },
        ),
        centerTitle: true,
        title: Text(widget.title ?? '图片预留'),
      ),
      body: Column(
        children: [
          if(widget.url?.isNotEmpty == true)
            Expanded(child: SingleChildScrollView(child : Image.network(widget.url!))),
        ],
      ),
    );
  }
}
